package flc.ast.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.FileUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyFileBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class HomeVideoAdapter extends StkProviderMultiAdapter<MyFileBean> {

    public HomeVideoAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(70));
        addItemProvider(new HomeVideoProvider());
    }

    private class HomeVideoProvider extends BaseItemProvider<MyFileBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_home_video;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyFileBean bean) {
            Glide.with(getContext()).load(bean.getUrl()).into((ImageView) baseViewHolder.getView(R.id.ivHomeVideoItemImg));
        }
    }
}
